import { openDirectoryDialog, getFileBufByFilePath, getFileDataByFilePath } from './fileDialog'
import { scanAudioFiles } from './audioScanner'
import { getAllMacAddresses } from './macAddress'
import request from './requestProxy'

export const setupIPC = (ipcMain) => {
  ipcMain.handle('open-directory-dialog', openDirectoryDialog)
  ipcMain.handle('scan-audio-files', (event, dirPath) => scanAudioFiles(dirPath))
  ipcMain.handle('get-file-buf', (event, filePath) => getFileBufByFilePath(filePath))
  ipcMain.handle('get-file-data', (event, filePath) => getFileDataByFilePath(filePath))
  ipcMain.handle('get-mac-address', getAllMacAddresses)
  ipcMain.handle('request-proxy', (event, requestConfig) => request(requestConfig))
}
